package model;

public class Vertex implements IVertex {

	/**
	 * 
	 */
	private static final long serialVersionUID = -798331987846409490L;
	
	// ATTRIBUTS
	private String content;
	
	// CONSTRUCTEURS
	public Vertex(String content) {
		if (content == null) {
			throw new IllegalArgumentException("content argument is null");
		}
		this.content = content;
	}
	
	// REQUETES
	public String getContent() {
		return this.content;
	}
	
	public boolean equals(Object vertex) {
		if (vertex instanceof Vertex) {
			return ((Vertex) vertex).getContent().equals(this.content);
		} 
		return false;
	}
	
	public int hashCode() {
		return this.content.hashCode();
	}
	
	// COMMANDES
	public void setContent(String content) {
		if (content == null) {
			throw new IllegalArgumentException("content argument is null");
		}
		this.content = content;
	}

}
